﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Index.aspx.cs" Inherits="Index" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">em{font-style:normal;color:#cc0000}</style>
</head>
<body style="font-family:Arial, Sans-Serif; font-size:14px">
    <form id="form1" runat="server" defaultbutton="BtnSubmit">
    <div>
        <asp:TextBox ID="TxtQuery" runat="server" Height="18px" />
        <asp:Button ID="BtnSubmit" runat="server" Text="搜索" onclick="BtnSubmit_Click" />
        <br />
        <asp:Label ID="LabResultSummary" runat="server" Font-Size="10px" Text="" />
    </div>
    <div>
        <asp:ListView ID="ListViewResult" runat="server" DataSourceID="ObjectDataSourceResult"
            EnableModelValidation="True">
            <EmptyDataTemplate>
                <span>找不到和您的查询相符的内容或信息。
                    <br />
                    <br />
                    建议：
                    <ul>
                        <li>请检查输入字词有无错误。</li>
                        <li>请尝试其他的查询词。</li>
                        <li>请改用较常见的字词。</li>
                    </ul>
                </span>
            </EmptyDataTemplate>
            <ItemTemplate>
                <span style="">
                    <br />
                    <a href="<%# Eval("URL") %>" style="font-size:16px;color:#223AE1"><%# Eval("Title") %></a>
                    <br />
                    DocID: <asp:Label ID="DocIDLabel" runat="server" Text='<%# Eval("DocID") %>' />
                    , Rank: <asp:Label ID="RankLabel" runat="server" Text='<%# Eval("Rank") %>' />
                    <br />
                    <asp:Label ID="AbstractLabel" runat="server" Text='<%# Eval("Abstract") %>' Width="600" />
                    <br />
                    <asp:Label ID="URLLabel" runat="server" Text='<%# Eval("URL") %>' ForeColor="Green" />
                    <a href="Cache.aspx?id=<%# Eval("DocID") %>" style="font-size: small">网页快照</a>
                    <br />
                </span>
            </ItemTemplate>
            <LayoutTemplate>
                <div style="" id="itemPlaceholderContainer"
                    runat="server">
                    <span runat="server" id="itemPlaceholder" />
                </div>
                <br />
                <div style="">
                    <asp:DataPager ID="DataPager1" runat="server">
                        <Fields>
                            <asp:NextPreviousPagerField ButtonType="Link" ShowFirstPageButton="True" ShowNextPageButton="False"
                                ShowPreviousPageButton="False" />
                            <asp:NumericPagerField />
                            <asp:NextPreviousPagerField ButtonType="Link" ShowLastPageButton="True" ShowNextPageButton="False"
                                ShowPreviousPageButton="False" />
                        </Fields>
                    </asp:DataPager>
                </div>
            </LayoutTemplate>
        </asp:ListView>

        <asp:DataPager ID="DataPagerResult" runat="server" PagedControlID="ListViewResult">
        </asp:DataPager>

        <asp:ObjectDataSource ID="ObjectDataSourceResult" runat="server" 
            SelectMethod="GetQueryResult"
            TypeName="LingDong.QueryCore.Query" 
            ondatabinding="ObjectDataSourceResult_DataBinding" 
            onselected="ObjectDataSourceResult_Selected">
            <SelectParameters>
                <asp:ControlParameter ControlID="TxtQuery" Name="query" PropertyName="Text" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
    </div>
    </form>
</body>
</html>
